<template>
  <div class="app-container">
    <!-- Header 区域 -->

    <CartHeader></CartHeader>
    <!-- 商品 Item 项组件 -->
    <CartItem v-for="item in list" :key="item.id" :item="item"></CartItem>
    <!-- Foote 区域 -->
    <CartFooter></CartFooter>
  </div>
</template>
<script>

import { mapState } from 'vuex'
import CartHeader from './components/cart-header.vue'
import CartItem from './components/cart-item.vue'
import CartFooter from './components/cart-footer.vue'
export default {
  name: 'App',
  components: {
    CartHeader,
    CartItem,
    CartFooter
  },
  data () {
    return {
    }
  },
  created () {
    console.log(this.$store.dispatch('cart/getCartList'));

  },
  computed: {
    ...mapState('cart', ['list'])
  }

}
</script>

<style lang="less" scoped>
.app-container {
  padding: 50px 0;
  font-size: 14px;
}
</style>